<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<h1>JavaScript Example 18</h1>
<br>
Referencing Objects by id.
<br>
<hr>
<br>

<h1 id="main">Old Title</h1>

<p>

<!-- SCRIPT STARTS HERE -->

<script type="text/javascript">

	// flat reference by id - works with all browsers
	var newTitle = prompt("Enter new page title!");
	document.getElementById("main").innerHTML = newTitle;

</script>

<!-- SCRIPT ENDS HERE -->

</body>
</html>
